OUTER page# 0001 next
2: COMMENT ⊗   VALID 00047 PAGES
3: C REC  PAGE   DESCRIPTION
4: C00001 00001
5: C00006 00002    TITLE STANFORD A-I PDP-6/10 TIME-SHARING SYSTEM  6.16/M
6: C00007 00003    LIST OF INDEPENDENT MONITOR COMMAND FEATURES
7: C00010 00004     ACCUMULATOR ASSIGNMENTS
8: C00013 00005    MNEMONICS FOR DDB WORDS
9: C00016 00006        DEVICE SERVICE DISPATCH TABLE ASSIGNMENTS
10: C00018 00007     DEVICE CHARACTERISTICS WORD DEFINITIONS
11: C00021 00008     DDB ASSIGNMENTS, DEVCHR BITS
12: C00023 00009     I/O STATUS WORD ASSIGNMENTS
13: C00026 00010    REST OF BITS IN LH ARE DEVICE DEPENDENT EXCEPT BIT 14 WHICH
14: C00028 00011     JOB BUFFER AREA HEADER
15: C00029 00012    JOB STATUS WORD(JBTSTS IN IOINI1), ONE FOR EACH JOB
16: C00033 00013    JBTSIN SWAP IN LIST BITS
17: C00034 00014    JBTST2  TWO PROCESSOR INTERLOCKED SPACEWAR STATUS BITS
18: C00037 00015    PRIVILEGE BITS (IN JBTPRV AND JB2PRV)
19: C00042 00016    STATISTICS VARIABLES
20: C00044 00017     SYSTEM MACROS
21: C00046 00018    MORE SYSTEM MACROS
22: C00048 00019     MACROS TO SYNCHRONIZE PROCESSORS
23: C00049 00020    MACROS TO PUSH AND POP ACS, DISASTER MACROS
24: C00051 00021    PARAMETER ASSIGNMENTS FOR THIS SYSTEM.
25: C00053 00022     HERE, WE DEFINE THE LEGAL QUEUES AND QUANTUM TIMES
26: C00055 00023    DEVICE NAMES NOT IN THE ASSEMBLER.(IN INCREASING ORDER)
27: C00057 00024    IOP CONO/CONI BITS
28: C00058 00025    FIRST 19 JULY 67
29: C00062 00026    SYSDSP SYSTEM INITIALIZATION DISPATCH TABLE, STARTING AT LOC 200
30: C00064 00027     AT LOCATION 210 BEGINS THE LIST OF USEFUL LOCATIONS
31: C00066 00028     HERE LIE THE ROUTINES TO PUSH AND POP ACCUMULATORS
32: C00068 00029    THIS PRINTS "YOU'RE IN DDT" AND ENTERS DDT.
33: C00069 00030     THIS PART HANDLES AUTOMATIC RELOADS AND RESTARTS
34: C00072 00031     WAIT FOR THE PDP-6 TO CATCH UP BEFORE RELOADING
35: C00074 00032     HERE WE PUT A ROUTINE INTO THE ACS AND JUMP TO IT WHILE SYSTEM IS BEING READ IN
36: C00076 00033     ROUTINE TO TYPE ON THE CONSOLE TELETYPE
37: C00078 00034     THIS ROUTINE SKIPS AND SETS DISFLAG AND TURNS OFF PI'S IF
38: C00079 00035    OTHER SYSTEM DATA STORAGE
39: C00081 00036     P2 INITIALIZATION WAIT LOOP. WAITS FOR P1 TO TELL IT TO GO
40: C00082 00037     INTERRUPT BIT DEFINITIONS, APR CONI BIT DEFINITIONS
41: C00085 00038    IOINIT -- CHANNEL LINKAGES AND SAVE ROUTINES.
42: C00087 00039     MORE PI CHANNEL ROUTINES FOR P1
43: C00089 00040     MORE PI CHANNEL ROUTINES FOR P1
44: C00091 00041     CHANNEL ROUTINES FOR P2
45: C00093 00042     MORE P2 INTERRUPT ROUTINES
46: C00095 00043    CHANNEL SAVE AND RESTORE CODE.
47: C00097 00044    DSKSAV:TVSAV:
48: C00098 00045     P2 PI CHANNEL AC SAVE AND RESTORE ROUTINES
49: C00100 00046     P2 INTERRUPT AC STORAGE AND PD LISTS
50: C00101 00047     HERE WE DEFINE THE CHANNEL NUMBERS, CHANNEL TRAP LOCATIONS AND
51: C00103 ENDMK
52: C⊗;
    OUTER page# 0002 next  prev
54: TITLE STANFORD A-I PDP-6/10 TIME-SHARING SYSTEM  6.16/M
55: SUBTTL  OUTER BLOCK CODE AND SYMBOL DEFINITIONS
56: 
57: DEFINE XD(SYMBOL,VALUE),<SYMBOL←←VALUE>
58: DEFINE XP(SYMBOL,VALUE),<SYMBOL←←VALUE>
59: 
60: XD      SW3330,-1
61: XD      SW2314,0
    OUTER page# 0003 next  prev
63: ;LIST OF INDEPENDENT MONITOR COMMAND FEATURES
64: ;THESE FEATURES CAN BE ELIMINATED FROM A SYSTEM BY
65: ;SETTING THE APPROPRIATE FTXXXX SYMBOL BELOW TO 0
66: ;AND REASSEMBLING. SOME OF THE ROUTINES AFFECTED
67: ;BY EACH FEATURE ARE LISTED BELOW.
68: 
69: XD FTTALK,-1
70: 
71: XD FTATTACH,-1
72: 
73: XD FTSWAP,-1    ;SWAPPING SYSTEM
74:                 ;APPEARS IN APRSER,SCHEDU,SCNSER,DSKSER,SYSINI,STUFF,LOWCOR
75: 
76: XD FTDISK,-1    ;DISK SYSTEM
77:                 ;APPEARS IN APRSER,SYSINI,ONCE,STUFF,SCHEDU
78:                 ;IF FTDISK=-1,THEN FTLOGIN MUST BE -1
79: 
80: XD FTLOGIN,-1   ;LOGIN-LOGOUT COMMANDS AND UUOS
81:                 ;APPEARS IN APRSER,STUFF,LOWCOR
82:                 ;FTDISK IMPLIES FTLOGIN
83: 
84: 
85: IFNDEF FTDDT,{XD FTDDT,-1       ; SET TO -1 TO INCLUDE DDT}
86: IFN FTDDT,<XD EDDT,21>          ;EXEC MODE SYSTEM DDT
87: 
88: XD FTBAT,-1     ;SET TO -1 TO INCLUDE PHANTOM JOB(S) STARTUP
89: 
90: XD FTDSWP,FTDDT ;CHANGE TO 0 TO DISABLE SWAPPING DDT CODE!
91: 
92: IFNDEF IMPSW,<XD IMPSW,-1>      ;HAVE IMP UNLESS OTHERWISE SPECIFIED
93: 
94: XD FTHG,-1      ;SET TO -1 TO INCLUDE HISTOGRAM COLLECTION ROUTINES
95: 
96: XD FTOIKB,0     ;OLD III KEYBOARDS
97:                 ;APPEARS IN TTYSER, OUTER(CH5 CODE).
98:                 ;SET TO -1 TO INCLUDE SERVICE FOR OLD SCROUNGY KEYBOARDS.
99: 
100: XD FTSTAT,-1    ;SET TO -1 TO INCLUDE JAM'S SWAPPING STATISTICS
101: 
102: XD FTDSKPPN,-1  ;SET TO -1 TO ENABLE DISK PPN ALIAS'S
103: 
104: XD FTSHF1K,0    ;SET TO -1 TO ALLOW SHUFFLING 1K AT A TIME (BAD IDEA)
105: 
106: XD FTDDSTAT,0   ;SET TO -1 TO INCLUDE THE DATA DISK STATISTICS FEATURE
107: 
108: XD FTTTYBUG,-1  ;SET TO -1 FOR COMCNT BUG TRAPS
109: 
110: XD FTDRD,-1     ;SET FOR REDUNDANCY CHECKS/BUG TRAPS. (DEPT REDUNDANCY DEPT.)
111: 
112: XD FTXCTR,0     ;SET TO -1 TO SIMULATE XCT 1,
113: 
114: XD FTCORBUG,0   ;SET TO -1 FOR CORE TABLE CONSISTIENCY CHECK
115: 
116: XD FTTKBG,0     ;SET TO -1 FOR TALK RING BUG TRAPS
    OUTER page# 0004 next  prev
118: ; ACCUMULATOR ASSIGNMENTS
119: 
120: XALL
121: DEFINE XD (SYMBOL,VALUE) <SYMBOL←VALUE>
122: 
123: ;ACCUMULATOR ASSIGNMENTS
124: 
125: ;* MEANS LOADED BY UUO HANDLER ON ALL UUOS
126: 
127: XD IOS,0        ;*IO DEVICE STATUS WORD(SEE BELOW FOR BITS)
128: XD TAC,1        ;TEMPORARY(SOMETIMES PRESERVED ACCROSS SUB.)
129: XD TAC1,2       ;TEMPORARY(SOMETIMES PRESERVED ACCROSS SUB.)
130: XD PDP,3        ;*PUSH DOWN POINTER(SEPARATE LIST FOR EACH PI
131: XD P,PDP
132: PDP←←PDP        ;ONLY PRINT P
133:                 ;CHANNEL AND EACH USER JOB
134: XD ITEM,4       ;BUFFER ITEM COUNT, OR JOB NUMBER
135: XD J,ITEM
136: ITEM←←ITEM
137: XD DAT,5        ;TTY OUTPUT BUFFER POINTER FOR COMMANDS,ERROR
138:                 ;MESSAG         ;OR TEMPORARY
139: XD JBUF,DAT     ;ADDRESS OF 3 WORD BUFFER HEADER IN USER AREA
140: XD DEVDAT,6     ;*LH=UUOS DONE SO FAR FOR THIS DEVICE(SEE BELOW)
141:                 ;RH=ADDRESS OF DEVICE DATA BLOCK
142: XD DDB,DEVDAT
143: DEVDAT←←DEVDAT
144: XD PROG,7       ;*LH=HIGHEST REL. LOC. IN USER AREA
145:                 ;RH=ABSOLUTE ADDRESS OF USER AREA
146: XD JDAT,PROG    ;*RH=ADDRESS OF JOB DATA AREA
147:                 ;LH=HIGHEST REL. LOC. IN USER AREA
148: XD JDMPRG,0     ;HAS THE VALUE OF JDAT-PROG
149: 
150: XD TEM,10       ;TEMPORARY USED ONLY SCNSER IO ROUTINE
151: 
152: 
153: XD DSER,11      ;*ADDRESS OF DEVICE SERVICE ROUT. DISPATCH TABLE
154: XD BUFPNT,12
155:                 ; CONTENTS OF FIRST WORD OF 3 WORD USER BUFFER HEADER
156: XD UCHN,BUFPNT  ;*USER IO CHANNEL NO.
157: XD PID,13       ; IN DEMOCRACY, THIS IS THE PROCESSOR DATA AREA ADDRESS
158: XD UUO,14       ;*CURRENT UUO IN PROGRESS
159:                 ;PROG IN INDEX FIELD FOR RELOCATION
160: XD AC1,15       ;TEMPORARY ACS(MORE TEMPORARY THAN TAC,TAC1)
161: XD AC2,16
162: XD AC3,17
163: 
164: ;AC FIELD DEFINITIONS FOR XCTR
165: IFE FTXCTR,<
166: XR←←4
167: XW←←1
168: XRW←←5
169: XLB←←1
170: XDB←←1
171: XEW←←11        ;FOR MOVEM @1(UUO)
172: >
173: IFN FTXCTR,<
174: ↓XR←←2
175: ↓XW←←4
176: ↓XRW←←6
177: ↓XLB←←10
178: ↓XDB←←12
179: >
180: DEFINE XD (SYMBOL,VALUE) <SYMBOL←←VALUE>
    OUTER page# 0005 next  prev
182: ;MNEMONICS FOR DDB WORDS
183: ; SOME BITS IN TTYTAB, USED EVERY WHERE IN THE WORLD
184: COMBIT←←400000          ;COMMAND WAITING BIT
185: DLYBIT←←200000          ;DELAYED COMMAND BIT
186:                         ;"COMMAND" ONLY SERVICES TTY WHEN COMBIT
187:                         ;IS SET!
188: 
189: ; DEVICE DATA BLOCK DEFINITIONS
190: 
191:         XD STTIBF,30            ;SIZE OF SYSTEM TTY INPUT BUFFER
192:         XD STTOBF,30            ;SIZE OF SYSTEM TTY OUTPUT BUFFER
193:         XD UTTYBF,30            ;SIZE OF USER TTY BUFFER
194:         XD LPP,=24              ;NUMBER OF LINES ON A SCOPE
195:         XD WPL,=17              ;NUMBER OF WORDS TO A LINE ON SCOPE
196:         XD LINLGD,WPL*5-3       ;NUMBER OF CHRS ALLOWED
197:         XD DDBSKW,1             ; NUMBER OF WORDS IN FRONT OF DDB CURRENTLY USED
198: 
199: ; DEVICE DATA BLOCK NAMES
200:         XD DEVCMR,-1            ; MORE DEVICE CHARACTERISTICS
201:         XD DEVNAM,0             ;NAME IN SIXBIT ASCII
202:                                 ;C(LH)=DEVICE MNEMONIC
203:                                 ;C(RH)=DEVICE NUMBER, LEFT JUSTIFIED
204:         XD DEVCHR,1             ;CHARACTERISTIC
205:                                 ;BITS 0-5=JOB NUMBER(BYTE POINTER=PJOBN)
206:                                 ;ZERO VALUE IMPLIES NOT ASSIGNED
207:         XD HUNGCT,100
208:                                 ; BITS 6-11 = HUNG DEVICE COUNT. SET WHEN
209:                                 ;DEVICE BECOMES ACTIVE. DECREMENTED EVERY SECOND.
210:         XD HUNGST,1
211:                                 ; BITS 12-17 = HUNG DEVICE COUNT
212:                                 ;SETTING. 0 MEANS DEVICE CAN NEVER BE HUNG.
213:         XD PUNITS,7
214:         XD PUNITP,22-PUNITS
215:                                 ;BITS 18-24=DEVICE NUMBER,BINARY(BYTE POINTER=PUNIT)
216:                                 ;BITS 25-35=BUFFER SIZE
217:         XD DEVIOS,2             ;STATUS WORD.  SEE BELOW
218:         XD DEVSER,3
219:                                 ; C(LH) = NEXT DEVICE DATA BLOCK
220:                                 ;C(RH)=DEVICE SERVICE DISPATCH TABLE
    OUTER page# 0006 next  prev
222: ;    DEVICE SERVICE DISPATCH TABLE ASSIGNMENTS
223:         XD DGIVDD,-4            ;RETURN DDB (SHARABLE)
224:         XD DGETDD,-3            ;MAKE DDB (")
225:         XD DINI,-2              ;DEVICE INITIALIZATION
226:         XD DHNG,-1              ;DEVICE IS HUNG
227:         XD DRL,0                ;RELEASE
228:         XD DCL,1                ;CLOSE
229:         ;IMMEDIATE ADDRESS PART OF CLOSE UUO
230:                 XD CLSOUT,1     ;INHIBIT CLOSING OUTPUT
231:                 XD CLSIN,2      ;INHIBIT CLOSING INPUT
232:         XD DOU,2                ;OUTPUT
233:         XD DIN,3
234:                                 ; INPUT, SHORT DISPATCH TABLE
235:         XD DEN,4                ;ENTER
236:         XD DLK,5                ;LOOKUP
237:         XD DDO,6                ;DUMP MODE OUTPUT
238:         XD DDI,7                ;DUMP MODE INPUT
239:         XD DSO,10               ;SETO
240:         XD DSI,11               ;SETI
241:         XD DGF,12               ;GETF UUO
242:         XD DRN,13               ;RENAME
243:         XD DCLI,14              ;CLOSE INPUT
244:         XD DCLR,15
245:                                 ; CALL D,[SIXBIT /UTPCLR/]
246:         XD DMT,16               ;MTAPE
247:                 ;END OF LONG DISPATCH TABLE
    OUTER page# 0007 next  prev
249: ; DEVICE CHARACTERISTICS WORD DEFINITIONS
250: 
251:         XD DEVMOD,4
252:                                 ; BITS 6-11 = LEFT HALF OF IMAGE MODE BYTE POINTER
253:                                 ;BIT 35-J=1 IF MODE J IS LEGAL FOR THIS DEVICE
254:                                 ;BIT 18 DEVICE ASSIGNED BY CONSOLE COMMAND
255:                                 ;BIT 19 DEVICE ASSIGNED BY PROGRAM (INIT)
256: 
257: ;RIGHT HALF OF DEVICE CHARACTERISTICS WORD(DEVCHR UUO)
258:         XD ASSCON,400000        ;ASSIGNED BY CONSOLE COMMAND ASSIGN
259:                 ;NOTE: READ CODE BETWEEN SYS1 & IOGO BEFORE CHANGING ASSCON
260:         XD ASSPRG,200000
261:                                 ; ASSIGNED BY PROGRAM (INIT UUO)
262: ;LEFT HALF DEVICE CHARACTERISTICS(DEVCHR UUO)
263:         XD DVOUT,1              ;OUTPUT DEVICE
264:         XD DVIN,2               ;INPUT DEVICE
265:         XD DVDIR,4              ;HAS A DIRECTORY
266:         XD DVTTY,10             ;IS A TTY
267:         XD DVMTA,20             ;IS A MAG TAPE(REWIND)
268:         XD DVAVAL,40
269:                                 ; 1 IF DEVICE IS AVAILABLE TO THIS JOB
270:                                 ;SET BY DEVCHR UUO
271:         XD DVDTA,100            ;IT IS A DECTAPE
272:         XD DVPTR,200            ;IS A PAPER TAPE READER
273:         XD DVPTP,400            ;IS A PAPER TAPE PUNCH
274:         XD DVLNG,1000
275:                                 ; INDICATES DEVICE HAS A LONG DISPATCH TABLE
276:                                 ;(OTHER UUOS BESIDES INPUT,OUTPUT,CLOSE,RELEASE)
277:         XD DVIMP,2000           ;IS AN ARPA INTERGALLACTIC MASSAGE POSTERIOR
278:         XD DVTV,4000            ; IS A TV CAMERA
279:         XD TTYUSE,10000         ;TTY DDB IN USE FLAG
280:         XD TTYATC,20000         ;TTY ATTACHED TO JOB IF 1
281:         XD DVLPT,40000          ;IS A LPT (CARRIAGE CONTROL IN FORTRAN)
282:         XD DVUDP,100000         ; IS A USER DISK PACK
283:         XD DVDSK,200000         ;IS A DISK
284:         XD DVDIRIN,400000       ;DECTAPE DIRECTORY IN CORE IF 1
    OUTER page# 0008 next  prev
286: ; DDB ASSIGNMENTS, DEVCHR BITS
287: 
288:         XD DEVLOG,5             ;LOGICAL NAME FOR JOB DEVICE
289:         XD DEVBUF,6
290:                                 ; C(LH) = RE. ADR. OF 3 WORD OUTPUT BUFFER HEADER
291:                                 ;C(RH)=REL. ADR. OF 3 WORD INPUT BUFFER HEADER
292:         XD DEVIAD,7
293:                                 ; C(LH) = PROG, IN INDEX FIELD
294:         XD DEVADR,DEVIAD
295:                                 ;C(RH)=REL. INPUT BUFFER ADD. SERVICE ROUT. IS FILLING
296:         XD DEVOAD,10
297:                                 ; C(LH) = PROG, IN INDEX FIELD
298:         XD DEVPTR,DEVOAD
299:                                 ;C(RH)=REL. OUTPUT BUFFER ADR. SERVICE ROU. IS EMPTYING
300:         XD DEVCTR,11
301: ;FOR LONG DISPATCH TABLE DEVICES ONLY:
302:         XD DEVFIL,11            ;FILE NAME IN SIXBIT
303:         XD DEVEXT,12            ;LH=EXTENSION, RH=UNUSED
304:         XD DEVPPN,13            ; PROJ-PROG NUMBER
305: ; LH OF DEVICE CHARACTERISTICS EXTENSION WORD, DEVCMR
306:         XD DEVIBF,400000        ;MEANS DEVICE HAS AN INTERNAL SYSTEM BUFFER
307:                                 ; AND DOES NOT SET IOACT, BUT SETS DEVSBB
308:         XD DEVAOA,200000        ; MEANS THAT THE DEVICE SERVICE ROUTINE MAY BE
309:                                 ; CALLED EVEN IF IO IS ACTIVE
310:         XD DEVSHR,100000        ;SHARABLE - MUST GET/RELEASE NEW DDBS
311: 
312:         XD DEVLUP,40000         ;REQUIRES LOCAL-USER STATUS TO INIT OR ASSIGN
313:         XD DEVMAS,20000         ;MUST ASSIGN DEVICE FIRST BEFORE DOING INIT
314:                                 ;ALSO OK IF USER HAS DEV INITED ALREADY
    OUTER page# 0009 next  prev
316: ; I/O STATUS WORD ASSIGNMENTS
317: ;DATA MODES: BITS 32-35(BYTE POINTER=PIOMOD)
318:         XP A,0                  ;ASCII
319:         XD AL,1                 ;ASCII LINE
320:         XP I,10                 ;IMAGE
321:         XD IB,13                ;IMAGE BINARY
322:         XP B,14                 ;BINARY
323:         XD SD,15                ;SCOPE DUMP MODE
324:         XD DR,16                ;DUMP BY RECORDS
325:         XP D,17                 ;DUMP ACROSS RECORDS
326: ; STATUS BITS
327: ;RIGHT HALF (USER)
328:         XD IOWC,20
329:                                 ; DON'T COMPUTE WORD COUNT
330:         XD IOCON,40             ;CONTINUOUS (CONT=0)
331:         XD IONRCK,100
332:                                 ; READ WITH NO REREAD CHECK FOR MTAPE
333:                                 ; FOR LPT - NO CHAR. CONVERSION
334:                                 ; FOR PTP - DON'T COMPUTE PARITY
335:                                 ; FOR XGP-ESCAPE TO OTHER MODES
336: ;BITS 27,28     DENSITY OF MAG TAPE
337: ;               00=INSTALATION STANDARD
338: ;               01=200 BPI
339: ;               10=556 BPI
340: ;               11=800 BPI
341:         XD IOPAR,1000
342:                                 ; MAG TAPE, BCD MODE, WRITE EVEN PARITY
343:         XD IOTEND,2000          ;END OF MAG TAPE
344:         XD IOBOT,4000           ;BEGINNING OF MAG TAPE
345:         XD IOACT,10000          ;DEVICE ACTIVE
346:         XD IODEND,20000         ;DATA END ENCOUNTERED
347:         XD IOBKTL,40000         ;BLOCK TOO LARGE
348:         XD IODTER,100000        ;DATA ERROR
349:         XD IODERR,200000        ;DEVICE ERROR
350:         XD IOIMPM,400000
351:                                 ; IMPROPER MODE, DETECTED BY THE
352:                                 ;INPUT SERVICE ROUTINE
353: ; LEFT HALF (SYSTEM)
354:         XD IOW,1                ;I/O WAIT
355:         XD IOBEG,2              ;VIRGIN DEVICE
356:         XD IOFST,4
357:                                 ; NEXT ITEM WILL BE THE FIRST ITEM OF A BUFFER
358:         XD IO,20                ;OUT=1, IN=0
359:         XD IOEND,40             ;SERVICE ROUTINE HAS TRANSMITTED LAST DATA
360:         XD DEVSBB,1000          ; MEANS INTERNAL SYSTEM BUFFER IS BUSY
    OUTER page# 0010 next  prev
362: ;REST OF BITS IN LH ARE DEVICE DEPENDENT EXCEPT BIT 14 WHICH
363: ;IS KEPT IN RESERVE.
364: 
365: 
366: ;LEFT HALF USRJDA (JOB DEVICE ASSIGNMENTS) UUO'S FOR THIS CHANNEL SINCE LAST INIT
367:         XD INITB,400000
368:                                 ; INIT - SAVEGET DEPENDS ON THIS BEING THE SIGN BIT
369:         XD IBUFB,200000
370:                                 ; INIT WITH INPUT BUFFER HEADER SPECIFIED
371:         XD OBUFB,100000
372:                                 ; INIT WITH OUTPUT BUFFER HEADER SPECIFIED
373:         XD LOOKB,40000          ;LOOKUP
374:         XD ENTRB,20000          ;ENTER
375:         XD INPB,10000           ;INPUT
376:         XD OUTPB,4000           ;OUTPUT
377:         XD ICLOSB,2000          ;INPUT CLOSE
378:         XD OCLOSB,1000          ;OUTPUT CLOSE
379:         XD INBFB,400            ;INBUF
380:         XD OUTBFB,200           ;OUTBUF
381:         XD SYSDEV,100
382:                                 ; THIS DEVICE IS A SYSTEM TAPE, OR UFD 1,3
383:                                 ;PROJ.PROG. NO 1,3 ON DSK
384:                                 ;RELEASE CLEARS THEM ALL
385: 
386: ;MTAPE UUO BITS
387:         XD SLICE,40
388:                                 ; SET SLICE LEVEL, IF 1, ACCORDING TO 'SLEVEL'
389:         XP SLEVEL,20
390:                                 ; VALUE OF SLICE LEVEL, IF SLICE IF 1
    OUTER page# 0011 next  prev
392: ; JOB BUFFER AREA HEADER
393:         XD JBFADR,0
394:                                 ; BIT 0 = 1 IF THIS BUFFER RING HAS NEVER BEEN
395:                                 ;REFERENCED FROM THE USER'S PROGRAM BY
396:                                 ;AN INPUT OR OUTPUT COMMAND.
397:                                 ;BITS 1-17=UNUSED
398:                                 ;BITS 18-35=CURRENT BUFFER ADDRESS
399:         XD JBFPTR,1
400:                                 ; BYTE POINTER TO NEXT BYTE-1
401:         XD JBFCTR,2             ;POSITIVE ITEM COUNT
402: ; JOB BUFFER HEADER
403:         XD IOUSE,400000
404:                                 ; 1 IF BUFFER IF FULL, OR BEING EMPTIED
405:                                 ;0 IF BUFFER IS EMPTY (OR BEING FILLED)
406:                                 ;BITS 1-17=BUFFER SIZE
407:                                 ;BITS 18-35=NEXT BUFFER ADDRESS
    OUTER page# 0012 next  prev
409: ;JOB STATUS WORD(JBTSTS IN IOINI1), ONE FOR EACH JOB
410: 
411:         XD RUN,400000           ;USER WANTS JOB TO RUN(MUST BE SIGN BIT)
412: 
413:         XD CMWB,200000          ;JOB TYPED A COMMAND WHICH NEEDS CORE
414:                                 ;WHICH IS ON DISK.  SET BY COMMAND DECODER
415:                                 ;CLEARED WHEN JOB IN CORE AGAIN.
416: 
417:         XD JACCT,100000         ;ACCOUNTING PGM RUNNING HERE, LOGIN OR LOGOUT
418: 
419:         XD JNA,40000            ;THIS JOB NUMBER IS ASSIGNED, JOB IS INITIALIZED
420: 
421:         XD JERR,20000           ;SYSTEM ERROR (PLDOV,ILM...)IN JOB. CAN'T CONTINUE.
422: 
423:         XD JLOG,10000           ;JOB SUCCESSFULLY LOGGED IN
424: 
425:         XD SHF,4000             ;MONITOR IS WAITING FOR DEVICES FOR THIS
426:                                 ;JOB TO STOP AFTER CURRENT BUFFERFULL
427:                                 ;SO JOB CAN BE SHUFFLED IN CORE
428: 
429:         XD SWP,2000             ;0 IF JOB IN CORE, 1 IF SWAPPED OUT OR ON WAY
430: 
431:         XD JSEG,1000            ; MEANS THAT THIS IS NOT A JOB BUT IS
432:                                 ; REALLY A HIGH SEGMENT WITH NO JOB DATA AREA
433: 
434:         XD CLKR,400             ;THIS JOB HAS A CLOCK REQUEST IN
435:                                 ;NEEDED SO ONLY ONE REQUEST PER JOB
436: 
437:         XD JWSIZ,5              ;SIZE OF WAIT CODE
438:         XD JWPOS,=14            ; RIGHT MOST BIT POSITION OF WAIT CODE
439:         XD WTMASK,370           ; MASK FOR CLEARING WAIT CODES
440:         ;BITS 10-14 USED TO INDICATE JOB IN WAIT FOR A SHARABLE DEVICE
441:         ;0 MEANS JOB NOT WAITING FOR SHARABLE DEVICE
442:         ;SEE SCHEDULER(CLKCSS) FOR DEFINITION OF WAIT CODES
443: 
444:         XD JHLDIN,2             ; SET TO KEEP JOB IN CORE (MAY BE SHUFFLED)
445:                                 ; CLEARED BY CLRSIN WHEN JBTSIN=0 FOR THE
446:                                 ; "OTHER" SEGMENT.
447: 
448:         XD JWP,1                ; IF JSEG IS ON, THEN THIS BIT MEANS THAT
449:                                 ; THIS UPPER SEGMENT IS WRITE PROTECTED
450: 
451: ; RH BITS IN JBTSTS . . .
452: 
453:         XD SAVJDA,400000        ; MEANS THAT JOBDATA AREA IS SAVED IN JBTPDL.
454: 
455:         XD WIPEJD,200000        ; MEANS 200 RST HAS HAPPENED AND
456:                                 ;   JOB WAS ON DISK AND COULDN'T GET WIPED
457:         XD JLOCK,100000         ;JOB IS LOCKED IN CORE AFTER A LOCK UUO.
458:         XD SDEADIN,040000       ; CORE DEADLOCK DETECTOR HAS A CLOCK REQUEST IN
459: 
460:         XD SDEAD1,20000         ; DEADLOCK CONDITION STILL EXISTS IF SDEADIN STILL ON.
461: 
462:         XD FBINP,010000         ; FAST-BAND TRANSFER IN PROGRESS
463: 
464:         XD FBERP,004000         ; ERROR ON LAST FAST-BAND TRANSFER
465: 
466:         XD FBJWT,002000         ; JOB WAITING FOR LAST TRANSFER
467: 
468:         ; BITS 30-35 ARE THE NUMBER OF THE HIGH SEGMENT THIS JOB HAS, ZERO IF NONE
469: 
470:         XD STOPIO,SWP+CMWB+SHF  ;FORCE JOB TO STOP FOR SWAP, SHUFFLE OR COMMAND
471: 
472:         XD RUNABLE,RUN+JNA      ; BITS NEEDED FOR A JOB TO BE RUNABLE
473: 
474:         XP RUNMSK,JLOG!CLKR!CMWB!JACCT!JHLDIN
475:                                 ;BITS WHICH DO NOT MATTER FOR RUNABILITY
476: 
477: 
478: REPEAT 0,<
479: ;; 2-PROCESSOR INTERLOCKED STATUS BITS (COULD BE FLUSHED)
480: ; LH BITS . . .
481:         XD RUN2,2               ; PROCESS RUNNABLE ON P2
482:         XD RUN1,1               ; PROCESS RUNNABLE ON P1
483: 
484: ; RH BITS . . .
485: 
486:         ;NONE YET
487: >
    OUTER page# 0013 next  prev
489: ;JBTSIN SWAP IN LIST BITS
490: 
491:         XD INTSNB,400000                ;INTERRUPT HANDLER
492:                                         ;CALL INTRUN AT FININ
493:         XD BATSNB,200000                ;PHANTOM STARTUP
494:                                         ;CALL BATSW AT FININ
495:         XD COMSNB,100000                ;DELAYED COMMAND
496:                                         ;CALL COMMAND AT FININ
497:         XD JRDSNB,40000                 ;JOB READ
498:                                         ;CALL JRSRCH AND JRDWIN AT FININ
499:         XD SPWSNB,20000                 ;FS OR LOCK FORCED SPACEWAR USER OUT
500:                                         ;TURN BIT OFF AT FININ
501: 
502:         ;BITS 24-29 BACKWARD LINK IN SWAP IN CHAIN
503:         ;BITS 30-35 FORWARD LINK IN SWAP IN CHAIN
504: 
505: ;BITS IN JBTSIN WHICH MAY HAVE TURNED ON JHLDIN IN JBTSTS FOR ANOTHER JOB
506: XD HLDSNB,INTSNB!COMSNB
507: 
508:         ;JOBS ENTERED AT END OF LIST, SWAPPED IN FROM FRONT
    OUTER page# 0014 next  prev
510: ;JBTST2 TWO PROCESSOR INTERLOCKED SPACEWAR STATUS BITS
511: 
512: ;JBTST2 IS USED FOR COMMUNICATING FROM THE SPACEWAR
513: ;SERVICE ROUTINE TO THE REST OF THE SYSTEM.  THE BITS IN
514: ;IT ARE DEFINED AS FOLLOWS:
515: 
516: ;LH BITS
517:         XD      SPWRUN,400000   ;THIS JOB HAS A SPACEWAR MODULE ACTIVE.
518:         XD      SPWGRT,200000   ;"I AM THE GREATEST", TO BE DEFINED LATER.
519:         XD      SPWSUS,100000   ;THE MONITOR WANTS THIS JOB TO STOP FOR SOME
520:                                 ;GOOD REASON (LIKE TO SHUFFLE IT).  GIVE THE
521:                                 ;SPACEWAR MODULE ONE MORE QUANTUM WITH A WARNING
522:                                 ;THAT IT WILL BE A WHILE UNTIL IT IS RUN AGAIN
523:         XD      SPWST1,40000    ;THIS JOB HAS BEEN WARNED AND IS STOPPED ON P1
524:         XD      SPWERB,20000    ;SPACEWAR MODULE HAS BEEN TERMINATED BY AN ERROR.
525:                                 ;BITS 18-35 ARE THE PC AT THE TIME OF THE ERROR.
526:         XD      SPWSU1,10000    ;SUSPENSION WARNING HAS BEEN GIVEN TO JOB ON P1
527:                                 ;THE ROUTINE WHICH IS ENTERED WHEN A SPW JOB DOES
528:                                 ;A UUO (TERMINATES) ACTUALLY DOES THE SUSPENSION.
529:         XD      SPWST2,4000     ;SAME AS SPWST1 FOR P2
530:         XD      SPWSU2,2000     ;SAME AS SPWSU1 FOR P2
531:         XD      SPWNT1,1000     ;NO TIMEOUT FOR P1
532:         XD      SPWNT2,400      ;NO TIMEOUT FOR P2
533: 
534: ;BITS 10-12 ARE NOT USED AS YET
535:                                 ;ERROR BITS:  SWPERB SET FOR ANY OF THESE.
536:         XD      ILLTMO,20       ;TIMEOUT FROM SPACEWAR
537:         XD      ILMSPW,10       ;ILL MEM REF FROM SPACE WAR MODE
538:         XD      NXMSPW,4        ;NXM FROM SPACE WAR MODE
539:         XD      POVSPW,2        ;PDLOV FROM SPACE WAR MODE
540:         XD      CNSSPW,1        ;CONS TRAP FROM SPACE WAR MODE
    OUTER page# 0015 next  prev
542: ;PRIVILEGE BITS (IN JBTPRV AND JB2PRV)
543: COMMENT  $
544: 
545: THE MONITOR  HAS BEEN  CHANGED SO  THAT CERTAIN  FUNCTIONS THAT  WERE
546: FORMERLY  RESTRICTED TO [1,2]  OR SOME  OTHER PRIVILEGED PPN  ARE NOW
547: AVAILABLE ON THE BASIS OF PRIVILEGE BITS INSTEAD OF BY PPN.
548: 
549: PRIVILEGE BITS ARE  KEPT FOR EACH JOB  IN JBTPRV.   JBTPRV IS SET  BY
550: THE LOGIN UUO.  THE LOGIN CUSP WILL DETERMINE WHAT  PRIVILEGES TO SET
551: FROM DATA THAT IS KEPT WITH THE USER'S PASSWORD.
552: 
553: A  NEW  UUO, SETPRV  HAS BEEN  ADDED  TO ALLOW  A  JOB TO  CHANGE ITS
554: PRIVILEGES.  SETPRV  WITH AN ARGUMENT OF  -1 WILL RETURN THE  CURRENT
555: SET  OF PRIVILEGES  IN  THE USER'S  AC;  ANY OTHER  ARGUMENT WILL  BE
556: INTERPRETED AS  AN ATTEMPT  TO CHANGE  PRIVILEGE BITS.  SUCH  ATTEMPT
557: WILL BE SUCCESSFUL  IF EITHER PRIPRV IS  ALREADY SET OR JACCT  IS SET
558: JBTSTS.  THE  RESULTING PRIVILEGE BITS WILL BE RETURNED IN THE AC, AS
559: AN INDICATION OF SUCESS OR FAILURE.
560: 
561: 
562: THE CURRENTLY IMPLEMENTED SET OF PRIVILEGES ARE::
563: 
564: NAME    BIT     FUNCTION
565: PRI     0       ALLOWS USER TO RESET HIS PRIVILEGES
566: DAW     1       ALLOWS ACCESS TO MTAPE WRITES ON THE DISK
567: PRO     2       ALLOWS ACCESS RENAME FILES
568: REA     3       ALLOWS ACCESS READ FILES
569: WRT     4       ALLOWS ACCESS WRITE FILES
570: UDP     5       ALLOWS ACCESS TO UDP'S WITHOUT PASSWORD
571: UPG     6       ALLOWS UPGSEL TO SELECT OTHER III'S, ALSO DD DIDLING
572: MES     7       CAN SEND MESSAGES TO BUSY CONSOLES
573: KIL     8       CAN DO MESSY KILL COMMAND
574: DEV     9       CAN DETACH DEVICES FROM SYSTEM
575: SEG     10      ALLOWS SEGMENT ACCESS AND SETPRO
576: SSL     11      ALLOWS SETTING SYSTEM SL RESERVATION TABLE
577: ACW     12      ABSOLUTE WRITES IN CORE THROUGH SETPR2
578: INF     13      ALLOWS ACCESS TO PASSWORD DATA
579: TLK     14      ALLOWS TALK COMMAND WHILE "BUSY".
580: FBW     15      ALLOWS ABSOLUTE WRITES ON LIBRASCOPE.
581:                 THIS IS INTENDED ONLY FOR STARTING SYSTEM IN USER MODE.
582: XGP     16      ALLOWS CALL ['XGPUUO']
583: 
584: MOST USERS WILL NEED NO PRIVILEGES, HOWEVER, REQUESTS FOR
585: PRIVILEGES WILL BE CONSIDERED.
586: 
587: $
588: 
589: 
590: DEFINE PRIVS
591: <
592: ;       LEFT HALF
593: XLPRIV PRI,400000               ;PRIVILEGE PRIVILEGE
594: XLPRIV DAW,200000               ;DISK ABSOLUTE WRITE 
595: ;  NEXT THREE MUST BE 100000,40000, AND 20000 UNLESS DSKSER IS CHANGED!!!
596: XLPRIV PRO,100000               ;FILE SYSTEM RENAME PRIV
597: XLPRIV REA,40000                ;FILE SYSTEM READ PRIV
598: XLPRIV WRT,20000                ;FILE SYSTEM WRITE PRIV
599: 
600: XLPRIV UDP,10000                ;READ LAST BLOCK OF UDP
601: XLPRIV UPG,4000                 ;SELECT OTHER DPYS WITH UPGIOT
602: XLPRIV MES,2000                 ;CAN DO TTYMES ARBITRARILY
603: XLPRIV KIL,1000                 ;CAN USE CONSOLE KILL COMMAND
604: XLPRIV DEV,400                  ;CAN USE DET/ATT DEVICE COMMAND
605: XLPRIV SEG,200                  ;SEGMENT ACCESS & SETPRO OK
606: XLPRIV SSL,100                  ;CAN SET SERVICE LEVEL RESERVATION TABLE
607: XLPRIV ACW,40                   ;CAN DO ABS MODE WRITE USING SETPR2
608: XLPRIV INF,20                   ;CAN READ AND WRITE SPECIAL FILE INFO
609: XLPRIV TLK,10                   ;CAN TALK TO ANY CONSOLE
610: XLPRIV FBW,4                    ;ALLOWS ABSOLUTE FBWRITE.
611: XLPRIV XGP,2                    ;THIS IS THE XGP FONT COMPILER
612: XLPRIV LUP,1                    ;LOCAL USER PRIVILEGE
613: >
614: 
615: DEFINE XLPRIV $ (NAM,VAL)
616: <XD     NAM$PRV,VAL>
617: 
618: ;DEFINE BITS
619: PRIVS
620: 
621: ;THESE ARE THE RESTRICTED PRIVILEGES FOR ENABLE COMMAND
622: RSPRVS←←<XWD XGPPRV!SSLPRV,0>
    OUTER page# 0016 next  prev
624: ;STATISTICS VARIABLES
625: ;LENGTH OF STATISTICS TABLE
626: XD      STATLEN,600
627: 
628: ;OPCODES FOR VARIOUS STATS
629: XD CSZSTA,000000                ;BYTE(1)0(3)0(8)HIGH ORDER BITS OF CORE SIZE(6)J#
630: XD CPSSTA,040000                ;BYTE(1)0(3)1(8)HIGH ORDER BITS OF CORE POSITION(6)J#
631: XD NAMSTA,400000                ;BYTE(1)1(5)0(6)UNUSED(6)J#
632:                                 ;FOLLOWING TWO 18 BIT BYTES ARE JOBNAME
633: XD QUESTA,410000                ;BYTE(1)1(5)1(6)QUEUE CODE(6)J#
634: XD SINSTA,420000                ;BYTE(1)1(5)2(6)JBTSIN BIT #(6)J#
635: XD SEGSTA,430000                ;BYTE(1)1(5)3(6)SEGMENT #(6)J#
636: XD SPWSTA,440000                ;BYTE(1)1(5)4(6)0-17:TICS OF SPW, 77:SPW OFF(6)J#
637: XD GLUSTA,450000                ;BYTE(1)1(5)5(6)JBTGLU COUNT(6)J#
638: XD LOKSTA,460000                ;BYTE(1)1(5)6(6)1:LOCKING, 0:UNLOCKING(6)J#
639: XD FITSTA,470000                ;BYTE(1)1(5)7(6)UNUSED(6)J#
    OUTER page# 0017 next  prev
641: ; SYSTEM MACROS
642: 
643: ;MACRO TO PREVENT SCHEDULING, USED AT UUO LEVEL WHEN A
644: ;REENTRANT ROUTINE IS CHANGING COMMON DATA NOT YET
645: ;ASSIGNED TO A PARTICULAR JOB
646: 
647: DEFINE NOSCHED
648: <>
649: 
650: ;MACRO TO ALLOW SCHEDULING ONCE MORE
651: 
652: DEFINE SCHEDULE
653: <>
654: 
655: ;MACRO TO PREVENT CORE SHUFFLING, USED AT UUO LEVEL WHEN
656: ;A ROUTINE SETS UP AN ABSOLUTE USER ADDRESS IN AN AC
657: ;OTHER THAN PDP,PROG, OR JDAT. THE MAIN EXAMPLE IS A BLT
658: ;FROM EXEC TO USER OR USER TO EXEC.
659: 
660: DEFINE NOSHUFF
661: <>
662: 
663: DEFINE SHUFFL
664: <>
665: 
666: ;MACRO TO START A DEVICE FROM UUO LEVEL
667: ;TAC:=XWD DEVINT FLAGS,CONO ARGUMENTS
668: 
669: DEFINE STARTDV ! (A)
670: <
671:         CONO PI,PIOFF
672:         HLRM TAC,A!CON
673:         CONO A,(TAC)
674:         CONO PI,PION
675: >
    OUTER page# 0018 next  prev
677: ;MORE SYSTEM MACROS
678: 
679: DEFINE CAT ! (A,B) <A!B>
680: 
681: OPDEF   CLRBFI  [TTYUUO 11,]
682: OPDEF   INWAIT  [TTYUUO 14,]
683: 
684: ;USER MODE DATA REFERENCE
685: IFE FTXCTR,<OPDEF XCTR [XCT]>
686: IFN FTXCTR,<OPDEF XCTR [107000,,]>
687: 
688: DEFINE TYPE (S) <
689:         PUSHJ P,TTYFUW          ; WAIT FOR OUTPUT TO FINISH
690:         CLRBFI                  ; CLEAR INPUT BUFFER TYPEAHEAD
691:         PUSHJ P,INLMES
692:         ASCIZ /S
693: /
694:         PUSHJ P,TYPGO           ; START UP TTY
695: >
696: 
697: DEFINE HGMAC(CODE)      <
698:         IFN FTHG,       <
699:                 JUMPN   PID,.+3
700:                 PUSH    P,[CODE]
701:                 POP     P,HGCODE        >>
702: 
703: ;MACRO TO DEFINE TABLES FOR SECONDARY DISPATCH UUOS
704: 
705: DEFINE UUOMAC(TBL,BASUUO)
706: {TBL:   UUOS
707: {       UUOMC2 X
708: }UUOCNT←←.-TBL
709:         BASUUO UUOCNT-1,UUOLNK
710: ↑↑UUOLNK←←.
711:         UUOS
712: {       <SIXBIT ,X,>
713: }}
714: 
715: DEFINE UUOMC2(A,B,C){B,,IFDIF<C><><C;>A}
716: 
717: UUOLNK←←0
    OUTER page# 0019 next  prev
719: ;; MACROS TO SYNCHRONIZE PROCESSORS
720: 
721:         XD PSYNCN,4     ; NUMBER OF CONTROL CELLS NEEDED
722: 
723: DEFINE SYNINI (A) <
724:         SETZM A
725:         SETZM A+1
726:         SETZM A+2
727:         SETZM A+3
728: >
729: 
730: DEFINE PSYNC1(A) <
731:         PUSHJ P,PWAIT
732:          A
733: IFIDN <A><><JFCL>
734: >
735: 
736: DEFINE PSYNC (A) <
737:         PUSHJ P,PWAIT
738:          MOVEI TAC,A
739: >
740: 
741: DEFINE XSYNC1(A) <
742:         PUSHJ P,XWAIT
743:          A
744: IFIDN <A><><JFCL>
745: >
746: 
747: DEFINE XSYNC (A) <
748:         PUSHJ P,XWAIT
749:          MOVEI TAC,A
750: >
    OUTER page# 0020 next  prev
752: ;MACROS TO PUSH AND POP ACS, DISASTER MACROS
753: 
754: FIXNUM←←10             ;NUMBER OF SECTORS TO READ AT A TIME IN SYSFIX
755: FIXLEN←←FIXNUM*40      ;TOTAL NUMBER OF WORDS
756: 
757: DEFINE PUSHACS <
758:         PUSHJ P,PUSHIT
759: >
760: DEFINE POPACS <
761:         PUSHJ P,POPIT
762: >
763: 
764: DEFINE DEBCHECK <
765:         SKIPE DEBMODE
766:         PUSHJ P,DDTCALL
767: >
768: ;THIS MACRO IS FOR USE IN CALLING DISERR IN COMCSS
769: ;EXAMPLE:
770: ;       PUSHJ P,DISERR
771: ;       DISARG  STR,[ASCIZ/TAC=/]
772: ;       DISARG  OCT,TAC
773: ;       DISARG  STR,[ASCIZ/
774: ;/]
775: ;       -1
776: ;WOULD TYPE:
777: ;       TAC=000000000030
778: ;
779: ;IF TAC CONTAINED 30
780: OPDEF OPZERO[0]
781: DEFINE DISARG $ (A,B)
782: <       A$QQQ B
783: >
784: DEFINE QQQNAM
785: <       ERRMAC  STR
786:         ERRMAC  CHR
787:         ERRMAC  OCT
788:         ERRMAC  LOC
789:         ERRMAC  DEC
790:         ERRMAC  SIX
791:         ERRMAC  DCP
792: >
793: DEFINE ERRMAC $ (I)
794: <       OPDEF I$QQQ [QQQ=23]
795: QQQ←←QQQ+1
796: >
797: QQQ←←0
798: 
799:         QQQNAM
    OUTER page# 0021 next  prev
801: ;PARAMETER ASSIGNMENTS FOR THIS SYSTEM.
802: 
803: XD LJOBN,100    ;3330 HAS ENOUGH ROOM FOR ALL 64 POSSIBLE JOBS
804: XD JOBN,100     ; IF NOT SWAPPING ON THE LIBRACROCK, CAN USE ALL JOB NUMBERS
805: XD NSPMEM,=2000 ;2 MICRO-SECONDS PER MEMORY CYCLE.
806: XD PTRNUM,1     ;ONE PAPER TAPE READER.
807: XD PTPNUM,1     ;ONE PAPER TAPE PUNCH.
808: XD LPTNUM,1     ;ONE LINE PRINTER.
809: XD CDRNUM,0     ;NO CARD READER.
810: XD TVNUM,1      ;ONE TV CAMERA
811: XD ADNUM,1      ;AN A/D CONVERTER.
812: 
813: XD DTCNUM,4     ;FOUR DEC TAPE DRIVES
814: XD MTCNUM,2     ;EIGHT MAG TAPES.
815: XD SCNNUM,20    ;SIXTEEN TTYS ON THE TTY SCANNER.
816: XD DPYNUM,6     ;NO. DISPLAY CONSOLES.
817: XD DDNUM,100-6  ; NUMBER OF DATA DISK TERMINALS
818: XD KBDNUM,DPYNUM        ;SAME NUMBER OF KEYBOARDS.
819: XD PTYNUM,24    ;NO. OF PSEUDO TELETYPES.
820: XD DILNUM,1     ;NO DIALERS YET
821: XD ELFNUM,1     ;NO. PERIPHERAL PROCESSORS (PDP-11'S) -- BO 6-MAY-74
822: XD IOPDLN,2*23  ;IO PUSH/POP STACK LENGTH, ENOUGH FOR ALL IO CHANNELS (ONCE)
823: XD CLKPLN,140   ;CLOCK PDL LENGTH
    OUTER page# 0022 next  prev
825: ; HERE, WE DEFINE THE LEGAL QUEUES AND QUANTUM TIMES
826: 
827: DEFINE QUEUES
828: <       X (FUCK)        ;THIS BECOMES QUEUE 0, WHICH IS ACTUALLY UNUSED
829:         X (ST)          ;SYSTEM TAPE WAIT
830:         X (DT)          ;DECTAPE CONTROL WAIT (UP TO 8 DRIVES)
831:         X (DC)          ;DATA CONTROL (DC) WAIT - MAGTAPE AND DECTAPE
832:         X (MT)          ;MAGTAPE CONTROL WAIT (UP TO 8 UNITS)
833: >
834: 
835: 
836: ;JOB STATUS CODES WHICH HAVE NO CORRESPONDING QUEUES
837: ;JOBS ARE UNRUNABLE WHEN IN THESE STATES
838: 
839: DEFINE CODES
840: <       X (IOW)         ;IO WAIT
841:         X (DIOW)        ; DISK IO WAIT
842:         X (DW)          ; DEVICE WAIT
843:         X (NUL)         ;JOB NUMBER NOT ASSIGNED
844:         X (STOP)        ;STOP (CONTROL C)
845:         X (INTW)        ; INTERRUPT WAIT
846:         X (SEG)         ; UPPER SEGMENT WAIT
847: >
848: 
849: DEFINE PQUEUES
850: <       X (RUN)         ; GENERALIZED RUN QUEUE
851:         X (T)           ; TELETYPE RUN QUEUE
852: >
853: 
854: ; QUANTUM TIME
855: 
856:         XD QQMQT,10     ; MINOR QUANTUM TIME
857:         XD JIFSEC,=60   ; NUMBER OF TICKS IN A SECOND
858:         XD JLLENGTH,=20 ; NUMBER OF PREVIOUS JOB LOAD FACTORS WE WILL KEEP
859:         XD JLTIME,2*JOBN        ;MUST BE THIS BIG AT LEAST!  REG 1-22-74
860: IFG =60-JOBN,<XD JLTIME,=120>   ;RECOMPUTE PRIORITIES EVERY 2.0 SECONDS
861: ;       XD SWAPLIMIT,=90*2000   ;NOW DEFINED IN CORDAT AS A CORE CELL.
    OUTER page# 0023 next  prev
863: ;DEVICE NAMES NOT IN THE ASSEMBLER.(IN INCREASING ORDER)
864: XD APR,0
865: XD PI,4
866: XD IOP,10       ;I/O PROCESSOR (167)
867: XD PTP,100
868: XD PTR,104
869: XD CTY,120
870: XD TTY,CTY
871: XD LPT,124
872: XD DC,200
873: XD DCB,204      ;DATA CONTROL (136)
874: XD DTC,210
875: XD DTS,214
876: XD MTC,220
877: XD MTS,224
878: XD MTM,230
879: XD ADC,240      ; NEW AD CONVERTER (PDP-6)
880: XD DAC,244      ; NEW DA CONVERTER (PDP-6)
881: XD DCSA,300
882: XD DCSB,304
883: XD DKB,310      ;MICROSWITCH KEYBOARD SCANNER
884: XD VDS,340      ;EARNEST VIDEO SWITCH
885: XD PK,370       ;(TELEPHONE) PAGING KLUDGE
886: XD DIL,374      ;AUTO DIALER
887: XD IMP,400      ; ARPA INTERGALLACTIC MASSAGE PROCESSOR
888: XD TV,404       ;TV CAMERA INTERFACE
889: XD PEN,414      ;LIGHT PEN ON DISPLAY
890: XD ARM,420      ;MECHANICAL ARM
891: XD AD,424       ;A/D CONVERTER
892: XD DPY,430      ;DISPLAY CONSOLES
893: XD KBD,434      ;THEIR KEYBOARDS
894: XD XGP,440      ;XEROX GRAPHICS PRINTER
895: XD DSK,444      ;DISK INTERFACE
896: XD D11,470      ;PDP-11 DATA TRANSFER INTERFACE
897: XD PMP,500      ;P. PETIT'S IBM CHANNEL
898: XD IBM,504      ;       "
899: XD DDD,510      ;DATA DISK DISPLAYS
900: XD PCLK,730     ;PETIT'S CALENDAR CLOCK
901: XD AS,774       ;AUDIO SWITCH
    OUTER page# 0024 next  prev
903: ;IOP CONO/CONI BITS
904: 
905: ;7              35-33 PI CHANNEL
906: XD      IOPJDN,10       ;JOB DONE
907: XD      IOPNXM,20       ;NON-EX-MEM
908: XD      IOPMIS,40       ;DATA MISS
909: 
910: XD      IOPPAR,100000   ;PARITY ERROR
911: XD      IOPRLY,200000   ;EARLY RESPONSE (ALSO SETS DATA MISS)
912: 
913: XD      IOPANY,IOPNXM!IOPMIS!IOPPAR!IOPRLY      ;ANY ERROR BIT
    OUTER page# 0025 next  prev
915: SUBTTL FIRST 19 JULY 67
916: ;STANDARD MAG TAPE DENSITY(556 BPI),PARITY(ODD-BINARY)
917:         XD STDENS,2
918:                                 ; STANDARD MAG TAPE DENSITY
919:                                 ;STDENS=D+P WHERE D AND P ARE:
920:                                 ;D=1(200 BPI);D=2(556 BPI);D=3(800 BPI)
921:                                 ;P=0(ODD-BINARY PARITY);P=4(EVEN-BCD PARITY)
922: ;NO. OF TIMES TO TRY ON DECTAPE ERRORS
923:         XD DTTRY,4
924:                                 ; NUMBER OF RETRYS ON DECTAPE ERRORS
925: ;SIZE OF MAGTAPE RECORDS(DATA WORDS IN BUFFER)
926:         XD MTSIZ,200
927:                                 ; SIZE FOF MAGTAPE RECORDS
928: ;SIZE OF LPT BUFFER(NO. OF DATA WORDS)
929:         XD LPTSIZ,=24
930:                                 ; SIZE OF LPT BUFFERS
931: ; SIZE OF LPT SYSTEM BUFFER
932:         XD LPTBLN,300
933: ; SIZE OF PTP SYSTEM BUFFER
934:         XD PTPBLN,320
935: ;MAX. NO. OF CONSECUTIVE DECTAPE BLOCKS BEFORE RESCHEDULING
936:         XD BLKQNT,=50
937:                                 ; MAX. NO. OF CONSECUTIVE DECTAPE BLOCKS BEFORE
938:                                 ;RESCHEDULING IF ANOTHER JOB WAITING
939: ; SPECIAL LOCATIONS IN MEMORY
940:         XD DDTMEM,37
941:                                 ; MEMORY SIZE FOR SYSTEM DDT AND SYSMAK
942:         XD DDTSYM,36
    OUTER page# 0026 next  prev
944: ;SYSDSP SYSTEM INITIALIZATION DISPATCH TABLE, STARTING AT LOC 200
945: ;THIS SUBROUTINE MUST BE LOADED FIRST
946: ;ROUTINE "ONCE" IS ONCE ONLY CODE. IT CONVERTS THE DATE
947: ;AND SETS UP IO SERVICE CHAIN,
948: 
949: IFN FTDDT,<
950:         LOC 74          ;CONVINCE SAVE COMMAND TO SAVE ENTIRE CORE IMAGE
951:         0,,DDT          ;AFTER LOADING WITH SYMBOLS
952: 
953:         LOC 162         ;POINTERS INTO DDT FOR BOOT HACK
954:         NOTDDT
955:         SYMLOC
956:         INDDT
957:         DDTSWP
958: BOOTWC:0               ;DDT STORES WCMA FOR IOP FOR SWAPPED USER CORE HERE
959: BOOTSE:0               ;DDT STORES SECTOR NUMBER FOR ABOVE HERE
960: >
961: 
962: LOC 200         ; THE SYSTEM IS AN ABSOLUTE ASSEMBLY, STARTING AT 200
963: 
964: ; 200 - INITIALIZE SYSTEM VARIABLES ONCE ONLY
965: SYSDSP: JRST SYSINI
966: 
967: ; 201 - GO INTO EXEC DDT
968: IFN FTDDT,<JRST DDT>
969: IFE FTDDT,<HALT .>
970: 
971: ; 202 - MAKE NEW SYSTEM OUT OF JOB 1
972:         JRST SYSMAK
973: 
974: ; 203 - INITIALIZE SYSTEM VARIABLES ALL OVER AGAIN
975:         JRST JSR2
976: 
977: ; 204 - P2 RESTART ADDRESS
978:         JRST .  ;LOOP HERE UNTIL PDP-10 IS READY. THEN JRST P2START
979: 
980: ; 205 - BRING MACHINE UP IN MAINTENANCE MODE
981:         HALT    .               ;NOT ANY MORE!
982: 
983: ; 206 - WRITE OUT SYSTEM ON THE DISK
984:         JRST BEGIN
985: 
986: ; 207 - STOP MONITOR, ERROR HALT, WRITES OUT LAST SAT BLOCK AND STOPS
987:         HALT    .       
    OUTER page# 0027 next  prev
989: ; AT LOCATION 210 BEGINS THE LIST OF USEFUL LOCATIONS
990: ;IN THE SYSTEM USED BY SYSTAT.
991: 
992: IFN FTSWAP,<
993: XWD 0,JBTSTSPRJPRGJBTSWPSPWGOTTIMEUPTIMECORMAXDEVLST
994: >
995: IFE FTSWAP,<
996: XWD 0,JBTSTS00SPWGOTTIMEUPTIME0DEVLST
997: >
998: ; THIS IS AT LOCATION 220
999: TTYTAB<BYTE(9)SCNNUM,DPYNUM,DDNUM,PTYNUM>JOBN-1JBTADRJBTQJOBNAMJOBCONFIG
1000: ;NEXT IS 230
1001: SP2GOJOBQUEJBTPRIJBTJLNQUESQNAMSJBTLINLETAB
1002: 
1003: ; NEXT IS LOC 240
1004: JBTJLH
1005: IFN FTSTAT, <   STATSJBTGSLSTATLENSTATPTRSTATNUM >
1006: IFE FTSTAT, <       0JBTGSL000      >
1007:                                                         INTIMESTBEG
1008: 
1009: ; NEXT IS AT 250
1010: JBTKCJJBTBTMLASTRESTARTTTYLOKMAINTMODEBIGHOLLASTDISASTERTIMESHFWAT
1011: ;NEXT IS AT 260
1012: STEND2FBBANDLISTEXPMODMEMSIZFSRPQSYSTOPCORTABNOLOGIN
1013: ;NEXT IS AT 270
1014: PTYJOBJBTPRVXWD UCLLEN9+UCLDLN,UCLTABXWD 0,DSKPPNFTIMENJOBSDSKOPSINITIM
1015: ;NEXT IS AT 300
1016: XWD -DISPL,COMTABFBACTLINTABASTABJB2PRVXWD -LFTLEN,LFTTABXWD -RHTLEN,RHTTABJBTSIN
1017: ;NEXT IS AT 310
1018: JBTGLUJOBNM1DDFCNT
1019: BLOCK 2 ;PATCH AREA FOR INTERESTING NEW POINTERS
    OUTER page# 0028 next  prev
1021: ; HERE LIE THE ROUTINES TO PUSH AND POP ACCUMULATORS
1022: 
1023: SIXRUN: JFCL            ;TESTED BY 6'S NULL JOB (MUST BE IN LOW CORE)
1024: 
1025: ↑↑PUSHIT:
1026:         PUSH P,0        ; SAVE 0
1027:         HLRE 0,P        ; PICK UP COUNT
1028:         ADDI 0,20       ; ADD IN DISPLACEMENT
1029:         XOR 0,P         ; IF SIGNS ARE DIFFERENT, NOT ENOUGH STACK
1030:         JUMPGE 0,PUSHOK
1031:         POP P,0         ; CAN'T DO IT, LOSE BIG
1032:         MOVE    TAC,[POINT 7,[ASCIZ ⊗NOT ENOUGH ROOM TO PUSH ACS.
1033: ]]
1034:         JSR DDTTYPE
1035:         CONSZ APR,MAOFF
1036:         JRST DDT
1037:         HALT AUTOLOAD
1038: 
1039: PUSHOK: POP P,0         ; GET BACK 0
1040:         EXCH 0,(P)      ;SAVE 0 AND GET RETURN.
1041:         MOVEM 0,20(P)   ;GEE, THIS WAY WE RETURN WITH A POPJ
1042:         MOVEI 0,1(P)
1043:         HRLI 0,1
1044:         BLT 0,17(P)
1045:         ADD P,[XWD 20,20]
1046:         POPJ P,         ;RETURN TO SENDER
1047: 
1048: ↑↑POPIT:
1049:         MOVSI 0,-17(P)
1050:         HRRI 0,1
1051:         BLT 0,17
1052:         MOVE 0,20(P)
1053:         EXCH 0,(P)
1054:         POPJ P,
    OUTER page# 0029 next  prev
1056: ;THIS PRINTS "YOU'RE IN DDT" AND ENTERS DDT.
1057: 
1058: DDTCALL:
1059:         MOVEM   TAC,DDTPAC
1060: IFN FTDDT,{
1061: IFN FTDSWP,<    SKIPE   NOTDDT                  ;ANY DDT?
1062:                 JRST    NXDDT                   ;NO     >;FTDSWP
1063:         MOVE    TAC,[POINT 7,[ASCIZ/YOU'RE IN DDT π↓π
1064: /]]
1065:         JSR     DDTTYPE
1066:         MOVE    TAC,DDTPAC
1067:         CONSZ   APR,MAOFF
1068:         JRST    DDT
1069:         JRST    4,DDT
1070: }
1071: 
1072: NXDDT:  MOVE TAC,[POINT 7,[ASCIZ/NO DDT
1073: /]]
1074:         JSR     DDTTYPE
1075:         MOVE    TAC,DDTPAC
1076:         POPJ    P,
1077: 
1078: DDTPAC: 0
    OUTER page# 0030 next  prev
1080: ; THIS PART HANDLES AUTOMATIC RELOADS AND RESTARTS
1081: AUTOLOAD:
1082:         CONSZ APR,MAOFF         ;ARE WE THE PDP-6
1083:         JRST AUTO10             ;PDP-10
1084:         CONO APR,200000
1085:         CONO PI,10400           ;RESET PI'S
1086:         JRST SYSDSP+4           ;P2 RESTART LOC
1087: 
1088: AUTO10: EXCH P,ERRPD
1089:         PUSHACS
1090:         SETOM DISFLAG
1091:         PUSHJ P,DISFLU
1092:         POPACS
1093:         SKIPN DEBMODE
1094:         CONSZ DSK,1B27
1095:         PUSHJ P,DDTCALL
1096:         CONO APR,200000
1097:         CONO PI,10400           ; RESET PI SYSTEM
1098:         PUSHJ P,DSKSTP          ; WRITE OUT SAT
1099:         CONO APR,200000
1100:         CONO PI,10400           ; RESET PI SYSTEM
1101:         SKIPN P2NUM             ;ANY SIX AT ALL?
1102:         JRST AUTO1              ;NO SKIP THE INTERLOCK
1103:         SETZM AUTOSYNC
1104:         MOVE TAC,[JSR AUTO6]
1105:         MOVEM TAC,46
1106:         MOVEM TAC,56
1107:         MOVEI TAC,200000
1108:         SKIPN AUTOSYNC
1109:         SOJG TAC,.-1
1110:         JUMPN TAC,AUTO1
1111:         SKIPE AUTOSYNC
1112:         JRST AUTO1
1113:         MOVE TAC,SIXPNT         ;PLEASE START PDP-6
1114:         JSR DDTTYPE
    OUTER page# 0031 next  prev
1116: ; WAIT FOR THE PDP-6 TO CATCH UP BEFORE RELOADING
1117: 
1118: AUTO2:  SETOM CH3
1119:         SETZM CH3               ; MAKE SURE PDP-6 GETS PAST INITIALIZE CODE
1120:         SKIPN AUTOSYNC
1121:         JRST AUTO2
1122: AUTO1:
1123:         MOVE TAC,RSTPNT         ;AUTO RESTART
1124:         JSR DDTTYPE
1125:         MOVE TAC,UPTIME
1126:         EXCH TAC,LASTRESTART
1127: REPEAT 0,<                      ;TIRED OF RESTARTS THAT DON'T WORK?
1128:         SUB TAC,UPTIME
1129:         MOVNS TAC
1130:         CAIG TAC,=60*JIFSEC
1131:         JRST AUTO3
1132:         MOVE TAC,MONPTR
1133:         PUSHJ P,CHECK
1134:         CAME TAC1,MONSUM
1135: >
1136:         JRST AUTO3
1137:         SETZM AUTOSYNC  ; IF MONITOR IS STILL OK, DO A 200 RESTART
1138:         JRST SYSDSP
1139: AUTO3:  HRLZI 17,AUTOL
1140:         BLT 17,17
1141:         JRST 0
1142: 
1143: SIXPNT: POINT 7,.+1
1144:         ASCIZ /
1145: PLEASE START THE PDP-6 AT 204
1146: /
1147: 
1148: RSTPNT: POINT 7,.+1
1149:         ASCIZ /
1150: AUTOMATIC RESTART
1151: /
1152: 
    OUTER page# 0032 next  prev
1154: ; HERE WE PUT A ROUTINE INTO THE ACS AND JUMP TO IT WHILE SYSTEM IS BEING READ IN
1155: 
1156: AUTO6:  0
1157:         CONO PI,10400
1158:         CONO APR,200000
1159:         MOVE 1,[MOVE 17,AUTOSYNC]
1160:         MOVE 2,[JUMPN 17,1]
1161:         MOVE 3,[SOJG 0,3]
1162:         MOVE 4,[JRST AUTO4]
1163:         MOVEI 0,100000
1164:         SETOM AUTOSYNC
1165:         JRST 1
1166: 
1167: AUTO4:  MOVE TAC,[JSR P2CH3]    ; RESTORE INTERRUPT LOCATIONS
1168:         MOVEM TAC,46
1169:         MOVE TAC,[JSR P2CH7]
1170:         MOVEM TAC,56
1171:         JRST SYSDSP+4
1172: 
1173: DEBMODE:
1174:         0
1175: 
1176: AUTOL:
1177:         PHASE 0
1178: AUTOL3: CONO DSK,1B23!1B24
1179:         CONO IOP,0
1180:         DATAO IOP,AUTOL1
1181:         JFCL
1182:         JFCL
1183:         DATAO DSK,SYSBAND
1184:         CONSO IOP,IOPANY!IOPJDN ;WAIT FOR SOMETHING TO HAPPEN
1185:         JRST .-1
1186:         CONSZ IOP,IOPANY        ;DID SOMETHING BAD HAPPEN
1187:         HALT 0
1188:         SETZM AUTOSYNC
1189:         JRST SYSDSP
1190: 
1191: AUTOL1: XWD -=76*2000,0
1192: 
1193: DEPHASE
1194: 
1195: 
    OUTER page# 0033 next  prev
1197: ; ROUTINE TO TYPE ON THE CONSOLE TELETYPE
1198: ; ENTER WITH BYTE PTR TO ASCIZ IN TAC.
1199: 
1200: ...TM2: 0                               ;TEMPORARY CELL
1201: ↑↑DDTTYPE:
1202:         0                               ;JSR TO HERE.
1203:         MOVEM   TAC1,...TM2             ;SAVE TAC1
1204: DDTTY1: ILDB    TAC1,TAC                ;GET BYTE
1205:         JUMPE   TAC1,DDTTY2             ;NULL ENDS THE MESSAGE
1206:         CONSZ   CTY,20                  ;WAIT FOR OUTPUT BUSY TO BE OFF.
1207:         JRST    .-1
1208:         DATAO   CTY,TAC1                ;TYPE CHARACTER
1209:         CONSO   CTY,40                  ;DID THEY TYPE ANYTHING (INPUT DONE)
1210:         JRST    DDTTY1                  ;NO. - LOOP TO GET NEXT CHARACTER
1211:         DATAI   CTY,TAC1                ;YES. READ CHARACTER.
1212: DDTTY3: CONSZ   CTY,20
1213:         JRST    .-1                     ;WAIT TO ECHO CHARACTER
1214:         DATAO   CTY,TAC1                ;ECHO
1215:         CAIE    TAC1,15                 ;CR?
1216:         JRST    DDTTY4                  ;NO. STOP NOW.
1217:         MOVEI   TAC1,12
1218:         JRST    DDTTY3                  ;YES. GO DO A LF.
1219: 
1220: DDTTY4: ILDB    TAC1,TAC                ;FLUSH UNTIL NULL BYTE
1221:         JUMPN   TAC1,.-1                ;BEACUSE SOME PEOPLE RETURN TO 1(TAC)
1222: 
1223: DDTTY2: MOVE    TAC1,...TM2             ;RESTORE TAC1
1224:         JRST    @DDTTYPE
1225: 
    OUTER page# 0034 next  prev
1227: ; THIS ROUTINE SKIPS AND SETS DISFLAG AND TURNS OFF PI'S IF
1228: ;THE SYSTEM SHOULD BE RESTARTED
1229: 
1230: ALTNOW: MOVE TAC,UPTIME
1231:         EXCH TAC,LASTDISASTERTIME
1232:         SUB TAC,UPTIME
1233:         MOVNS TAC
1234:         CAILE TAC,=60*JIFSEC
1235:         POPJ P,
1236:         CONO PI,PIOFF
1237:         AOS (P)
1238:         SETOM DISFLAG
1239:         POPJ P,
    OUTER page# 0035 next  prev
1241: ;OTHER SYSTEM DATA STORAGE
1242: ;LOCATIONS SETUP BY ONCE ONLY OPERATOR DIALOGUE
1243: 
1244: DETFLG: 0                       ; TELLS SYSINI THAT AD AND DIS ARE TO BE DETACHED FROM THE SYSTEM
1245: CRKTIM: 0                       ; TIME OF DAY TO BE PASSED ALONG
1246: CRKDAT: 0                       ; DATE CELL
1247: P1NUM:  0                       ; PROCESSOR 1 NUMBER
1248:                                 ; HAS BIT 'MAOFF' SET IN LH IF P1 IS IN MA TRAP OFFSET
1249: P2NUM:  0                       ; PROCESSOR 2 NUMBER AND MAOFF FLAG
1250: PWRCNT: 1B17                    ; POWER FAILURE COUNT DOWN
1251: P2RCNT: 1B17                    ; P2 POWER FAILURE COUNT DOWN
1252: XJBPFI: XWD JOBPFI,0
1253:                                 ;JOBPFI=HIGHEST LOC. IN USER JOB DATA AREA
1254:                                 ;PROTECTED FROM IO
1255: IFN FTLOGIN,<                   ;DEC 3.16
1256: REFLAG: 0                       ;DEC 3.16
1257: ;IF REFLAG IS NON-ZERO (SET BY REFRESH CODE IN ONCE) THEN THE
1258: ;FIRST USER TO TYPE "LOGIN" IS GIVEN IT AS A PROGECT-PROGRAMMER
1259: ;NUMBER.
1260: MAINTMODE:      0               ; IF MAINTMODE≠0, ONLY GOD MAY LOG IN.
1261: NOLOGIN:        0               ; SET ≠ 0 TO PREVENT LOGINS
1262: EXPMOD:         0               ;IF ≠ 0 THEN X.TXT[2,2] IS TYPED BY LOGIN
1263: BLTSWP:         0               ;IF ≠ 0 THEN BLT CORE IMAGE AFTER SWAPIN
1264: >
1265: SYSSIZ: SYSMAK                  ;SIZE OF MONITOR(FIRST LOC NOT USED)
    OUTER page# 0036 next  prev
1267: ; P2 INITIALIZATION WAIT LOOP. WAITS FOR P1 TO TELL IT TO GO
1268: 
1269: P2XFR1: JRST .+1
1270: P2XFR:  AOJA 0,.
1271:         AOJA 0,.
1272:         JRST 4,-1
1273: 
1274: PICON:  CONO PI,32237           ; PI ENABLE CHNS 3, 5, 6, AND 7
1275:                                 ; AND PARITY BOX
1276: P2CON:  CONO PI,32237           ; PI ENABLE FOR P2
1277: INIMES: .+1
1278: ASCIZ /SYSTEM LOADED ON /
1279: SAVITM: 0                       ; SOMEWHERE IN IOINIT
    OUTER page# 0037 next  prev
1281: ; INTERRUPT BIT DEFINITIONS, APR CONI BIT DEFINITIONS
1282: 
1283:         XD      PION,200
1284:         XD      PIOFF,400
1285:         XD      USRMOD,10000
1286:         XD      ADRBRK,040000
1287:         XD      IOTUSR,100000
1288:         XD      MAOFF,40
1289: 
1290: REPEAT 0,<
1291: ;SYSTEM WRITE REFERENCE KLUGE:
1292: ;SYS WR REF KLUGE IS ENABLED BY DATAO PTR,[1]. DISABLED BY DATAO PTR,[0]
1293:         XD      SYSCLB,400000           ;SYSTEM STOMPED FLAG (CONI)
1294:         XD      CLRCLB,100000           ;CLEAR SAME (CONO)
1295:         XD      SWRENB,4000             ;SYSTEM WRITE REFERENCE ENABLED (CONI)
1296: >
1297: 
1298:         XD      SAVDMP,'DMP'
1299: 
1300: ;USER INTERRUPT BIT ASSIGNMENTS - LH FIRST . . .
1301:         XD      INTSWW,400000           ; INTERRUPT BEFORE SWAPPING
1302:         XD      INTSWD,200000           ; INTERRUPT WHEN SWAP DONE
1303:         XD      INTSHW,100000           ; INTERRUPT BEFORE SHUFFLING
1304:         XD      INTSHD,040000           ; INTERRUPT WHEN SHUFFLE COMPLETE
1305:         XD      INTTTY,020000           ; INTERRUPT ON TELETYPE INPUT
1306:         XD      INTPTI,010000           ; INTERRUPT ON PSEUDO-TELETYPE INPUT
1307:         XD      INTMAIL,004000          ; INTERRUPT ON MAIL
1308:         XD      INTWAIT,002000          ; INTERRUPT ON UUO COMPLETE
1309:         XD      INTPTO,001000           ; INTERRUPT ON PSEUDO-TELETYPE OUTPUT
1310:         XD      INTPAR,000400           ; PARITY ERROR INTERRUPT
1311:         XD      INTCLK,000200           ; CLOCK INTERRUPT
1312:         XD      INTINR,000100           ; IMP INTERRUPT BY RECEIVER
1313:         XD      INTINS,000040           ; IMP INTERRUPT BY SENDER
1314:         XD      INTIMS,000020           ; IMP STATUS CHANGE INTERRUPT
1315:         XD      INTINP,000010           ; IMP INPUT WAITING
1316:         XD      INTTTI,000004           ; INTERRUPT ON <ESC>I
1317:         XD      INTQXF,2                ;INTERRUPT ON Q XFER
1318:         XD      INTHAL,1                ; INTERRUPT ON ↑C HALT
1319: ; INTERRUPT BIT ASSIGNMENTS - RH
1320:         XD      CNS,400000              ; INTERRUPT ON CONS TRAP
1321:         XD      POV,200000              ; INTERRUPT ON PDL OV
1322:         XD      ILM,20000               ; INTERRUPT ON ILL. MEM. REF.
1323:         XD      NXM,10000               ; INTERRUPT ON NON-EX. MEM.
1324:         XD      INTFOV,100              ; INTERRUPT ON FOATING OVERFLOW
1325:         XD      INTOV,10                ; INTERRUPT ON ARITHMETIC OVERFLOW
1326: 
1327: 
1328: DEVLST:
1329: IFN FTDISK,<XWD DSKDDB,0>
1330: IFE FTDISK,<XWD PTRDDB,0>
1331: 
1332: ;THE FOLLOWING ARE USED TO CREATE MXQUE
1333: ;THE MAXIMUM QUEUE SIZE
1334:         XD      MXQUE,0
1335: 
1336: DEFINE  X (A)   <MXQUE←←MXQUE+1;>
1337: 
1338:         QUEUES
1339:         CODES
1340:         PQUEUES
1341: 
1342: NQUES←←MXQUE    ;THIS IS USED TO PUT THIS VALUE INTO WORD 234
    OUTER page# 0038 next  prev
1344: ;IOINIT -- CHANNEL LINKAGES AND SAVE ROUTINES.
1345: SUBTTL IOINIT   J. SAUTER, 04-AUG-68
1346: 
1347: ;INTERRUPT ROUTINE LINKAGES
1348: ;IF THE CHANNEL OF A DEVICE IS CHANGED IN S,
1349: ;  THE CODE HEREIN MUST BE CHANGED AS WELL.
1350: 
1351: ;USED IN ONCE
1352: 
1353: CH1:   0
1354: IFN ADNUM,<
1355:         JRST ADINT              ;A-D IS THE ONLY THING  ON CH1.
1356: >
1357:         JEN     @CH1
1358: 
1359: CH2:   0
1360:         JEN     @CH2
1361: 
1362: CH3:   0
1363: DPYCON: CONSZ   DPY,400000      ; III PROCESSOR?
1364:         JRST    DPYINT          ; YES
1365:         CONSZ   510,20          ; DATA DISK?
1366:         JRST    DDINT           ; YES
1367:         CONSZ   PI,1B18         ; POWER FAILURE?
1368:         JRST    PWROFF          ; OH DEAR?
1369: PARCON: CONSZ   PI,1B20         ;PARITY ERROR?
1370:         JRST    PARINT          ;YES.
1371: 
1372: APRCON: CONSO   APR,400         ;THIS IS THE PDP-10 NOT APR INTERRUPT BIT
1373:         JRST    APRINT          ;YES.
1374:         JEN     @CH3
1375: 
1376: CH4:   0
1377: IFG DTCNUM,<
1378: DTCCON: CONSZ   DTS,0           ;DEC TAPE CONTROLLER?
1379:         JRST    DTCINT          ;YES.>
1380: IFE DTCNUM+MTCNUM,<
1381:         SKIPE   DTCFLAG         ; DEC TAPE - MAG TAPE STARTUP INTERRUPT?
1382:         JRST    DTCINT          ; YES.>
1383: IFG MTCNUM,<
1384: MTCCON: CONSZ   MTS,0           ;MAG TAPE CONTROLLER?
1385:         JRST    MTCINT          ;YES.>
1386: IFN IMPSW,<
1387:         CONSZ   IMP,040000      ; ERROR BIT
1388:         JRST    IMPERB          ; YES, HE MIGHT BE DEAD
1389:         CONSZ   IMP,030000      ; INPUT DONE OR INPUT END?
1390:         JRST    IMPINT
1391: IMPOTS: CONSZ   IMP,004000      ; OUTPUT DONE?
1392:         JRST    IMPOUT          ; YES
1393: IMPCTS:
1394: >
1395:         JEN     @CH4
    OUTER page# 0039 next  prev
1397: ; MORE PI CHANNEL ROUTINES FOR P1
1398: 
1399: CH5:   0
1400: IFN LPTNUM,<
1401: LPTCON: CONSZ   LPT,0           ;LINE PRINTER?
1402:         JRST    LPTINT          ;YES.>
1403: 
1404: IFG SCNNUM,<
1405:         CONSZ   DCSA,1010       ;TELETYPE SCANNER?
1406:         JRST    SCNINT          ;YES.>
1407: 
1408: IFG KBDNUM,<
1409:         CONSZ   DKB,10          ;MICROSWITCH KEYBOARD?
1410:         JRST    DKBINT          ;YES
1411: 
1412: IFN FTOIKB,<
1413:         CONSZ   KBD,40          ;OLD DISPLAY CONSOLE KEYBOARD?
1414:         JRST    KBDINT          ;YES    >>
1415: 
1416:         CONSZ   TTY,50          ;CONSOLE TELETYPE?
1417:         JRST    CTYINT          ;YES.
1418: 
1419:         CONSZ   PK,7            ;PIA?
1420:         CONSO   PK,10           ;INTERRUPT BIT?
1421:         JRST    .+2
1422:         JRST    PKINT           ;(TELEPHONE) PAGING KLUDGE (IN TTYSER)
1423: 
1424: IFN PTRNUM,<
1425: PTRCN1: CONSZ   PTR,0           ;PAPER TAPE READER?
1426:         JRST    PTRINT          ;YES.>
1427: 
1428: IFN CDRNUM,<
1429: CDRCON: CONSZ   CDR,0           ;CARD READER?
1430:         JRST    CDRINT          ;YES.>
1431:         JEN     @CH5
1432: 
1433: ;       NOTE:   SCNINT IS PLACED FIRST BECAUSE DISCONNECTED TELETYPES
1434: ;               RUN OPEN, FLOODING THE SYSTEM WITH INTERRUPTS.  SINCE
1435: ;               THE VASE MAJORITY OF CH5 INTERRUPTS ARE OF THIS NATURE
1436: ;               TTYS SHOULD BE THE FIRST TO BE CHECKED.
1437: 
1438: ;       NOTE:   FOR SIMILAR REASONS, DKBINT IS PLACED JUST AFTER SCNINT.
1439: ;               ALSO, LPTINT IS NOW FIRST SINCE THE LPT GENERATES INTERRUPTS
1440: ;               AT A VERY HIGH RATE WHILE LOADING THE BUFFER.
    OUTER page# 0040 next  prev
1442: ; MORE PI CHANNEL ROUTINES FOR P1
1443: 
1444: CH6:   0
1445: IFN FTDISK,<
1446:         CONSZ   PMP,20          ; 2314 MAYBE?
1447:         CONSO   PMP,4           ;IS IT US OR D2CHN?
1448:         CAIA                    ;NOT US!
1449:         JRST    IXINT           ; YES, DO YO' STUFF, BWANA SAHIB!
1450: >
1451: IFN TVNUM,<
1452: TVCON:  CONSZ   IOP,0           ;I/O PROC. FOR TV CAMERA?
1453:         JRST    TVINT           ;YES.>
1454: IFN FTDISK,<
1455: DIPCON: CONSZ   IOP,IOPANY!IOPJDN;I/O PROCESSOR FOR DISK?
1456:         JRST IFBINT
1457:         CONSZ   DSK,3370        ;DISK INTERFACE?
1458:         JRST DFBINT
1459: >
1460: IFN PTPNUM,<
1461: PTPCN1: CONSZ   PTP,0           ;PAPER TAPE PUNCH?
1462:         JRST    PTPINT          ;YES.>
1463: IFN DILNUM,<
1464:         CONSZ   DIL,20
1465:         JRST    DILINT          ;DIALER INTERRUPT
1466: >;IFN DILNUM
1467: IFN ELFNUM,<                    ;BO 6-MAY-74
1468:         CONSZ D11,770000        ;ERROR INTERRUPT FROM THE PDP-11?
1469:         JRST ELFINT
1470: >;ELFNUM
1471:         JEN     @CH6
1472: 
1473: CH7:   0
1474:         SKIPLE  CLKFLG          ;CLOCK INTERRUPT?
1475:         JRST    CLKINT          ;YES.
1476:         SKIPGE CLKFLG
1477:         JRST CLKIN0             ;SPECIAL ENTRY FOR USRXIT KLUDGE
1478:         JEN     @CH7
    OUTER page# 0041 next  prev
1480: ; CHANNEL ROUTINES FOR P2
1481: 
1482: P2CH1: 0
1483: IFN ADNUM,<
1484: ADJMP:  JFCL    ADINT           ; SERVE IT! (TURNED INTO JRST WHEN RUNNING)
1485: >
1486:         CONSZ   DAC,2000        ; NEW DA CONVERTER INTERRUPTING?
1487: DACJMP: JRST    DACIST          ; YES
1488:         CONSZ   ADC,40          ; NEW AD CONVERTER INTERRUPTING?
1489: ADCJMP: JRST    ADCIST          ; YES, GO SERVICE
1490:         JEN     @P2CH1
1491: 
1492: P2CH2: 0
1493:         CONSZ   XGP,XGPDON      ;XGP INTERFACE INTERRUPTING?
1494:         JRST    XGPINT          ;YES. PROCESS INTERRUPT.
1495:         JEN     @P2CH2
1496: 
1497: P2CH3: 0
1498:         CONSZ   PI,1B18         ; POWER FAILURE?
1499:         JRST    P2ROFF          ; OH DEAR!!
1500: P2RCON: CONSZ   PI,1B20         ; PARITY ERROR MAYBE?
1501:         JRST    P2RINT          ; P2 PARITY ROUTINES
1502: AP2CON:
1503:         CONSZ   APR,631200      ; APR FLAG BITS FOR P2(CHECKS PC CHNG ENB)
1504:         JRST    AP2INT          ; GO TO P2 APR ROUTINES
1505:         JEN     @P2CH3
    OUTER page# 0042 next  prev
1507: ; MORE P2 INTERRUPT ROUTINES
1508: 
1509: P2CH4: 0
1510: P2CH4S:MOVEM   17,CH4SA2+17    ;SAVE AC'S FOR XGPSER COMPILER
1511:         MOVE    17,[JEN @P2CH4]
1512:         MOVEM   17,P2CH4E       ;SET THE EXIT INSTRUCTION TO NORMAL
1513:         MOVEI   17,CH4SA2
1514:         BLT     17,CH4SA2+16
1515:         MOVSI   17,XGPSAC       ;GET OLD AC'S FROM COMPILER
1516:         BLT     17,17
1517:         JRST    @X2DISP
1518: X2DISP: .+1                     ;JSR HERE TO CO-ROUTINE COMPILER
1519:         MOVEM   17,XGPSAC+17
1520:         MOVEI   17,XGPSAC
1521:         BLT     17,XGPSAC+16
1522:         MOVSI   17,CH4SA2
1523:         BLT     17,17
1524: P2CH4E:JEN     @P2CH4          ;CHANNEL 4 EXIT LOCATION.  CLOBBERED BY CH2.
1525: 
1526: P2CH5: 0
1527: IFN PTRNUM,<
1528: PTRCN2: CONSZ   PTR,0           ; PTR ON THIS PROCESSOR?
1529:         JRST    PTRINT          ; YES, SERVICE IT
1530: >
1531:         JEN     @P2CH5
1532: 
1533: P2CH6: 0
1534: IFN PTPNUM,<
1535: PTPCN2: CONSZ   PTP,0           ; PTP ON THIS PROCESSOR?
1536:         JRST    PTPINT
1537: >
1538:         JEN     @P2CH6
1539: 
1540: P2CH7: 0
1541:         SKIPLE  CLKFLG+P2PID    ; APR CLOCK INTERRUPT
1542:         JRST    CL2INT
1543:         SKIPGE CLKFLG+P2PID
1544:         JRST CL2IN0
1545:         JEN     @P2CH7
    OUTER page# 0043 next  prev
1547: ;CHANNEL SAVE AND RESTORE CODE.
1548: ;  AGAIN, THESE DEPEND ON THE CHANNEL VALUES.
1549: 
1550: 
1551: CH1SAV: 0               ;JSR HERE
1552:         MOVEM   17,CH1SAC+17
1553:         MOVEI   17,CH1SAC
1554:         BLT     17,CH1SAC+16
1555:         MOVE    P,[IOWD INTPLN,CH1PDL]
1556:         MOVEI   PID,P1PID
1557:         PUSHJ   P,@CH1SAV
1558: CH1RET: MOVSI   17,CH1SAC
1559:         BLT     17,17
1560:         JEN     @CH1
1561: 
1562: DTCSAV:MTCSAV:
1563: 
1564: CH4SAV: 0               ;JSR HERE
1565:         MOVEM   17,CH4SAC+17
1566:         MOVEI   17,CH4SAC
1567:         BLT     17,CH4SAC+16
1568:         MOVE    P,[IOWD INTPLN,CH4PDL]
1569:         MOVEI   PID,P1PID
1570:         PUSHJ   P,@CH4SAV
1571: CH4RET:
1572:         MOVSI   17,CH4SAC
1573:         BLT     17,17
1574:         JEN     @CH4
1575: 
1576: 
1577: KBDSAV:SCNSAV:CDRSAV:LPTSAV:PKSAV:
1578: 
1579: CH5SAV: 0               ;JSR HERE.
1580:         MOVEM   17,CH5SAC+17
1581:         MOVEI   17,CH5SAC
1582:         BLT     17,CH5SAC+16
1583:         MOVE    P,[IOWD INTPLN,CH5PDL]
1584:         MOVEI   PID,P1PID
1585:         PUSHJ   P,@CH5SAV
1586: CH5RET:
1587:         MOVSI   17,CH5SAC
1588:         BLT     17,17
1589:         JEN     @CH5
    OUTER page# 0044 next  prev
1591: DSKSAV:TVSAV:
1592: IFN ELFNUM <ELFSAV:ELDSAV:>
1593: 
1594: CH6SAV: 0               ;JSR HERE.
1595:         MOVEM   17,CH6SAC+17
1596:         MOVEI   17,CH6SAC
1597:         BLT     17,CH6SAC+16
1598:         MOVE    PDP,[IOWD INTPLN,CH6PDL]
1599:         MOVE    PID,[P1PID]
1600:         PUSHJ   PDP,@CH6SAV
1601: CH6RET: MOVSI   17,CH6SAC
1602:         BLT     17,17
1603:         JEN     @CH6
1604: 
1605: INTPLN←←100     ; LENGTH OF I-LEVEL PUSHDOWN LISTS
1606: 
1607: CH1PDL: BLOCK   INTPLN
1608: CH4PDL:
1609:         BLOCK   INTPLN
1610: CH5PDL: BLOCK   INTPLN
1611: CH6PDL: BLOCK   INTPLN
1612: 
1613: CH1SAC: BLOCK   20
1614: CH4SAC: BLOCK   20
1615: CH5SAC: BLOCK   20
1616: CH6SAC: BLOCK   20
    OUTER page# 0045 next  prev
1618: ; P2 PI CHANNEL AC SAVE AND RESTORE ROUTINES
1619: 
1620: ADCSAV:
1621: DACSAV:
1622: CH1SV2: 0
1623:         MOVEM 17,CH1SA2+17
1624:         MOVEI 17,CH1SA2
1625:         BLT 17,CH1SA2+16
1626:         MOVE PDP,[IOWD INTPLN,CH1PD2]
1627:         MOVE PID,[P2PID]
1628:         PUSHJ PDP,@CH1SV2
1629:         MOVSI 17,CH1SA2
1630:         BLT 17,17
1631:         JEN @P2CH1
1632: 
1633: XGPSAV:
1634: CH2SV2: 0
1635:         MOVEM   17,CH2SA2+17
1636:         MOVEI   17,CH2SA2
1637:         BLT     17,CH2SA2+16
1638:         MOVE    P,[IOWD INTPLN,CH2PD2]
1639:         MOVE    PID,[P2PID]
1640:         PUSHJ   P,@CH2SV2
1641:         MOVSI   17,CH2SA2
1642:         BLT     17,17
1643:         JEN     @P2CH2
1644: 
1645: REPEAT 0,<
1646: CH4SV2: 0
1647:         MOVEM 17,CH4SA2+17
1648:         MOVEI 17,CH4SA2
1649:         BLT 17,CH4SA2+16
1650:         MOVE PDP,[IOWD INTPLN,CH4PD2]
1651:         MOVE PID,[P2PID]
1652:         PUSHJ PDP,@CH4SV2
1653:         MOVSI 17,CH4SA2
1654:         BLT 17,17
1655:         JEN @P2CH4
1656: >
1657: 
1658: CH5SV2: 0
1659:         MOVEM 17,CH5SA2+17
1660:         MOVEI 17,CH5SA2
1661:         BLT 17,CH5SA2+16
1662:         MOVE PDP,[IOWD INTPLN,CH5PD2]
1663:         MOVE PID,[P2PID]
1664:         PUSHJ PDP,@CH5SV2
1665:         MOVSI 17,CH5SA2
1666:         BLT 17,17
1667:         JEN @P2CH5
1668: 
1669: CH6SV2: 0
1670:         MOVEM 17,CH6SA2+17
1671:         MOVEI 17,CH6SA2
1672:         BLT 17,CH6SA2+16
1673:         MOVE PDP,[IOWD INTPLN,CH6PD2]
1674:         MOVE PID,[P2PID]
1675:         PUSHJ PDP,@CH6SV2
1676:         MOVSI 17,CH6SA2
1677:         BLT 17,17
1678:         JEN @P2CH6
    OUTER page# 0046 next  prev
1680: ; P2 INTERRUPT AC STORAGE AND PD LISTS
1681: 
1682: CH1PD2: BLOCK INTPLN
1683: CH2PD2: BLOCK INTPLN
1684: ;CH4PD2:        BLOCK INTPLN
1685: CH5PD2: BLOCK INTPLN
1686: CH6PD2: BLOCK INTPLN
1687: 
1688: CH1SA2: BLOCK 20
1689: CH2SA2: BLOCK 20
1690: CH4SA2: BLOCK 20
1691: CH5SA2: BLOCK 20
1692: CH6SA2: BLOCK 20
1693: 
1694: ; INDIRECT AC SAVE LOCATIONS FOR 2-PROC SYSTEM
1695: 
1696: PTPSAV: CH6SAV
1697: PTRSAV: CH5SAV
1698: ADSAV:  CH1SAV
1699: 
1700: ; THESE ARE BLT'ED UP THERE FOR 2-PROC MODE
1701: 
1702: ALTSAV: CH6SV2
1703:         CH5SV2
1704:         CH1SV2
    OUTER page# 0047 next  prev
1706: ; HERE WE DEFINE THE CHANNEL NUMBERS, CHANNEL TRAP LOCATIONS AND
1707: ; THE PI CHANNEL ON AND OFF BITS
1708: 
1709: DEFINE X ! (A,B) <
1710: A!CHN←←B
1711: A!CHL←←CH!B
1712: A!ON←←1B25+1(7-B)
1713: A!OFF←←1B26+1(7-B)
1714: >
1715: 
1716: X AD,1          ;A/D ON CHANNEL 1.
1717: X ADC,1         ; NEW ANALOG-DIGITAL CONVERTER
1718: X DAC,1         ; NEW DIGITAL-ANALOG CONVERTER
1719: X DCT,1         ;DEC TAPE AND MAG TAPE DATA CONTROL CHANNEL.
1720: X D2,2          ;HIGH PRIORITY DISK CHANNEL
1721: X XGP,2         ;XEROX GRAPHICS PRINTER
1722: X APR,3         ;APR ON CHANNEL 3.
1723: X DPY,3         ; DISPLAY PROCESSOR ON CHANNEL 3.
1724: X DTC,4         ;DEC TAPE CONTROLLER.
1725: X MTC,4         ;MAG TAPE CONTROLLER.
1726: X IMP,4         ; ARPA IMP
1727: X KBD,5         ;KEYBOARDS FOR DISPLAY CONSOLES.
1728: X SCN,5         ;TELETYPE SCANNER.
1729: X CTY,5         ;CONSOLE TELETYPE.
1730: X PTR,5         ;PAPER TAPE READER.
1731: X CDR,5         ;CARD READER.
1732: X LPT,5         ;LINE PRINTER.
1733: X DSK,6         ;DISK INTERFACE.
1734: X DIP,6         ;IOP FOR DISK.
1735: X IOP,6
1736: X TV,6          ;TV CAMERA.
1737: X PTP,6         ;PAPER TAPE PUNCH.
1738: X DIL,6         ;PHONE DIALER
1739: X ELF,6         ;PDP-11 ERRORS
1740: X ELD,6         ;PDP-11 DATA
1741: X CLK,7         ;CLOCK FOR SCHEDULING.
1742: 
1743: CL2CHL←←CAT(P2CH,\CLKCHN)
1744: AP2CHL←←CAT(P2CH,\APRCHN)
1745: 
1746: XGPCHL←←CAT(P2CH,\XGPCHN)
1747: XGPC2N←←4      ;CHANNEL FOR XGP LINE COMPILER.
1748: 
1749: ADCCHL←←CAT(P2CH,\ADCCHN)      ; DON'T FORGET US
1750: DACCHL←←CAT(P2CH,\DACCHN)
1751: 
1752: DEFINE XP(S,V)<↑S←←V>
 EOF: OUTER end-of-file. cnt=46